package com.lantosec.hmrp.modules.eval.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.eval.vo.EvalTaskItemVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * <p>
 * 任务考评项目 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EvalTaskItem extends BaseEntity<EvalTaskItemVO> {

    private static final long serialVersionUID = 1L;
    public EvalTaskItem(EvalTaskItemVO vo){
        this.evalTaskItemId = vo.getEvalTaskItemId();
        this.evalTaskId = vo.getEvalTaskId();
        this.evalItemId = vo.getEvalItemId();
        this.rewardOrientation = vo.getRewardOrientation();
        this.rewardType = vo.getRewardType();
        this.rewardStandard = vo.getRewardStandard();
        this.rewardUpLimit = vo.getRewardUpLimit();
        this.rewardLowLimit = vo.getRewardLowLimit();
    }

    @Override
    public EvalTaskItemVO convertToVO(){
        return new EvalTaskItemVO(this);
    }


    /**
     * 考评任务明细ID
     */
    @TableId(value = "eval_task_item_id", type = IdType.AUTO)
    private Integer evalTaskItemId;

    /**
     * 考评任务ID
     */
    private Integer evalTaskId;

    /**
     * 考评项目ID
     */
    private String evalItemId;

    /**
     * 考评奖惩方向(1分2钱)
     */
    private Integer rewardOrientation;

    /**
     * 考评奖惩形式(1奖2惩3奖与惩)
     */
    private Integer rewardType;

    /**
     * 考评奖惩标准(项目分值)
     */
    private BigDecimal rewardStandard;

    /**
     * 考评奖惩上限
     */
    private BigDecimal rewardUpLimit;

    /**
     * 考评奖惩下限
     */
    private BigDecimal rewardLowLimit;


    public enum ColName {
        eval_task_item_id, eval_task_id, eval_item_id, reward_orientation, reward_type, reward_standard, reward_up_limit, reward_low_limit, 
    }
}
